/**
 * @version 1.8
 * @Author Djx_hmbb
 * @Date 2023/8/9 8:27
 * @注释:
 * 1.得到进程的信息(id,name,priority,state)
 * 2.线程是否存活
 */
public class ThreadDemo6 {
    public static void main(String[] args)  {
        Thread t = new Thread(new Runnable() {
            @Override
            public void run() {
                for (int i = 0;i<3;i++) {
                    try {
                        System.out.println("hello Thread!");
                        Thread.sleep(1000);
                    } catch (InterruptedException e) {
                        e.printStackTrace();
                    }
                }

            }
        },"TD");
        t.start();

/*        System.out.println(t.getId());
        System.out.println(t.getName());
        System.out.println(t.getPriority());
        System.out.println(t.getState());*/
        while (true) {
            try {
                Thread.sleep(1000);
                System.out.println(t.isAlive());
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
        }
    }
}
